import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
import { ComputerInfo, ComputerService } from './computer.service';
import { ListResult, APIBase } from 'app/modules/base/api-base';

@Injectable({
	providedIn: 'root',
})
export class ListService implements Resolve<ListResult<ComputerInfo>> {
	constructor(private computerService: ComputerService) {}
	async resolve(route: ActivatedRouteSnapshot) {
		return this.computerService.list({ ...route.queryParams });
	}
}
